package com.developer.platform.domain.service;

import com.developer.platform.domain.security.AuthenticationInfo;
import org.springframework.security.core.Authentication;

/**
 * 身份认证接口
 *
 * @author ：qiaoliang
 * @date ：2020-11-06
 */
public interface IAuthenticationSource {

    /**
     *  根据访问令牌获取凭证信息
     *
     * @author ：qiaoliang
     * @return com.microorganism.platform.domain.security.Authentication
     * @date 2020-10-15 10:21
     */
    AuthenticationInfo loadAuthentication(String token);

    /**
     *  生成访问令牌
     *
     * @author ：qiaoliang
     * @param authenticationInfo :  账号的认证信息
     * @return java.lang.String
     * @date 2020-10-15 10:21
     */
    String loadGenerateToken(Authentication authenticationInfo);

    /**
     * 注销-删除token
     *
     * @author ：qiaoliang
     * @date 2020-11-05 10:40
     */
    default void removeToken(String token){

    }

    /**
     * 注销
     *
     * @author ：qiaoliang
     * @date 2020-11-05 10:40
     */
    default void kickOut(Long id){

    }

    /**
     * 删除资源信息
     *
     * @author ：qiaoliang
     * @date 2020-11-05 10:40
     */
    default void removeResources(Long id){

    }

}
